Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[app] Remove external_clusters flag #37817

Conversation

maciejbaczmanski
Copy link
Contributor

external_clusters flag is redundant as if an external cluster is created without correct implementation, build will fail anyway. Without the flag, clusters not provided in zap_cluster_list.json can be skipped without requiring to always provide full list of custom clusters.

Testing

tested on nrfconnect build with custom cluster added

Copy link

github-actions bot commented Feb 28, 2025

PR #37817: Size comparison from 50aa1d3 to a5422f7

Full report (60 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, linux, nxp, psoc6, qpg, stm32, tizen)
platform target config section 50aa1d3 a5422f7 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1096892 1096892 0 0.0
RAM 94842 94842 0 0.0
bl702 lighting-app bl702+eth FLASH 651870 651870 0 0.0
RAM 33509 33509 0 0.0
bl702+wifi FLASH 829142 829142 0 0.0
RAM 22233 22233 0 0.0
bl706+mfd+rpc+littlefs FLASH 1061538 1061538 0 0.0
RAM 32157 32157 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892382 892382 0 0.0
RAM 26896 26896 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 975278 975278 0 0.0
RAM 24644 24644 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 817152 817152 0 0.0
RAM 120272 120272 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 826072 826072 0 0.0
RAM 125368 125368 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 772956 772956 0 0.0
RAM 113740 113740 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 757240 757240 0 0.0
RAM 113948 113948 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540646 540646 0 0.0
RAM 205128 205128 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574794 574794 0 0.0
RAM 205376 205376 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 658861 658861 0 0.0
RAM 75412 75412 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 678713 678713 0 0.0
RAM 78052 78052 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 678713 678713 0 0.0
RAM 78052 78052 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 635645 635645 0 0.0
RAM 70480 70480 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 619101 619101 0 0.0
RAM 71652 71652 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 638737 638737 0 0.0
RAM 74196 74196 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 638737 638737 0 0.0
RAM 74196 74196 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 638589 638589 0 0.0
RAM 74660 74660 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 658305 658305 0 0.0
RAM 77204 77204 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 658305 658305 0 0.0
RAM 77204 77204 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614937 614937 0 0.0
RAM 68748 68748 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634789 634789 0 0.0
RAM 71388 71388 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634789 634789 0 0.0
RAM 71388 71388 0 0.0
efr32 lock-app BRD4187C FLASH 939672 939672 0 0.0
RAM 159920 159920 0 0.0
BRD4338a FLASH 732656 732656 0 0.0
RAM 234828 234828 0 0.0
window-app BRD4187C FLASH 1032104 1032104 0 0.0
RAM 128024 128024 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2653237 2653237 0 0.0
RAM 112272 112272 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5973656 5973656 0 0.0
RAM 516536 516536 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5299722 5299722 0 0.0
RAM 222456 222456 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4652070 4652070 0 0.0
RAM 201328 201328 0 0.0
camera-app debug unknown 5456 5456 0 0.0
FLASH 4675206 4675206 0 0.0
RAM 195776 195776 0 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13304951 13304951 0 0.0
RAM 603424 603424 0 0.0
chip-tool-ipv6only arm64 unknown 21976 21976 0 0.0
FLASH 11497864 11497864 0 0.0
RAM 656128 656128 0 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 11569745 11569745 0 0.0
RAM 603208 603208 0 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4455636 4455636 0 0.0
RAM 188168 188168 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5572629 5572629 0 0.0
RAM 471584 471584 0 0.0
lighting-app debug+rpc+ui unknown 6184 6184 0 0.0
FLASH 5518913 5518913 0 0.0
RAM 205136 205136 0 0.0
lock-app debug unknown 5424 5424 0 0.0
FLASH 4691888 4691888 0 0.0
RAM 192328 192328 0 0.0
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4314098 4314098 0 0.0
RAM 180984 180984 0 0.0
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4444418 4444418 0 0.0
RAM 185472 185472 0 0.0
shell debug unknown 4240 4240 0 0.0
FLASH 2982268 2982268 0 0.0
RAM 145688 145688 0 0.0
thermostat-no-ble arm64 unknown 9448 9448 0 0.0
FLASH 4141656 4141656 0 0.0
RAM 229832 229832 0 0.0
tv-app debug unknown 5752 5752 0 0.0
FLASH 5911477 5911477 0 0.0
RAM 595016 595016 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11475437 11475437 0 0.0
RAM 718656 718656 0 0.0
nxp contact k32w0+release FLASH 587368 587368 0 0.0
RAM 70980 70980 0 0.0
mcxw71+release FLASH 601192 601192 0 0.0
RAM 63096 63096 0 0.0
light k32w0+release FLASH 613100 613100 0 0.0
RAM 70268 70268 0 0.0
k32w1+release FLASH 685824 685824 0 0.0
RAM 48584 48584 0 0.0
lock mcxw71+release FLASH 750032 750032 0 0.0
RAM 67500 67500 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1658100 1658100 0 0.0
RAM 212344 212344 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1562380 1562380 0 0.0
RAM 208560 208560 0 0.0
light cy8ckit_062s2_43012 FLASH 1441180 1441180 0 0.0
RAM 197296 197296 0 0.0
lock cy8ckit_062s2_43012 FLASH 1470068 1470068 0 0.0
RAM 224960 224960 0 0.0
qpg lighting-app qpg6105+debug FLASH 663772 663772 0 0.0
RAM 105156 105156 0 0.0
lock-app qpg6105+debug FLASH 622240 622240 0 0.0
RAM 99768 99768 0 0.0
stm32 light STM32WB5MM-DK FLASH 459840 459840 0 0.0
RAM 141472 141472 0 0.0
tizen all-clusters-app arm unknown 5144 5144 0 0.0
FLASH 1770580 1770580 0 0.0
RAM 94144 94144 0 0.0
chip-tool-ubsan arm unknown 11492 11492 0 0.0
FLASH 18983958 18983958 0 0.0
RAM 8306328 8306328 0 0.0

" (hint: add to src/app/zap_cluster_list.json)" % (side, cluster))

cluster_sources.update(source_map[cluster])
if cluster in source_map:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we seem to lose an exception here and silently ignore a cluster that is not in a source map.

Silently skipping things will be hard to debug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a warning at a minimum or a flag that makes it "these are known non-sdk clusters, skip" (which I imagine is what the old flag was supposed to do)

Copy link
Contributor Author

@maciejbaczmanski maciejbaczmanski Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andy31415 . In my opinion the exception is redundant:

  • if vendor/end user adds a custom cluster, they must modify the .json file, even if they source custom cluster separately (for example they don't want to put the implementation in "${_app_root}/clusters/${cluster}/${cluster}.cpp")
  • if new common cluster is created, but not added to zap_cluster_list.json, build will fail as files are not sourced. I aggree that it would be worth adding a note, but I'm not sure if Build GN can parse python's stderr output in exec_script ?

Alternatively I could convert the external_clusters flag from list to just boolean flag, so that it should be only set if we use external clusters, but without a burden of listing all of them every time?

`external_clusters` flag is redundant as if an external cluster
is created without correct implementation, build will fail
anyway. Without the flag, clusters not provided in
`zap_cluster_list.json` can be skipped without requiring to
always provide full list of custom clusters.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
@maciejbaczmanski maciejbaczmanski force-pushed the matter_external_clusters branch from a5422f7 to cc09a20 Compare March 3, 2025 08:40
Copy link

github-actions bot commented Mar 3, 2025

PR #37817: Size comparison from b205837 to cc09a20

Full report (74 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section b205837 cc09a20 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1096868 1096866 -2 -0.0
RAM 94842 94842 0 0.0
bl702 lighting-app bl702+eth FLASH 651842 651842 0 0.0
RAM 33509 33509 0 0.0
bl702+wifi FLASH 829114 829114 0 0.0
RAM 22233 22233 0 0.0
bl706+mfd+rpc+littlefs FLASH 1061510 1061508 -2 -0.0
RAM 32157 32157 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892354 892352 -2 -0.0
RAM 26896 26896 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 975250 975248 -2 -0.0
RAM 24644 24644 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 817232 817232 0 0.0
RAM 120272 120272 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 826152 826152 0 0.0
RAM 125368 125368 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 773036 773036 0 0.0
RAM 113740 113740 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 757312 757312 0 0.0
RAM 113948 113948 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 540774 540774 0 0.0
RAM 205128 205128 0 0.0
lock CC3235SF_LAUNCHXL FLASH 574890 574890 0 0.0
RAM 205376 205376 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 658941 658941 0 0.0
RAM 75412 75412 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 678801 678801 0 0.0
RAM 78052 78052 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 678801 678801 0 0.0
RAM 78052 78052 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 635725 635725 0 0.0
RAM 70480 70480 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 619181 619181 0 0.0
RAM 71652 71652 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 638817 638817 0 0.0
RAM 74196 74196 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 638817 638817 0 0.0
RAM 74196 74196 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 638669 638669 0 0.0
RAM 74660 74660 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 658393 658393 0 0.0
RAM 77204 77204 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 658393 658393 0 0.0
RAM 77204 77204 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615009 615009 0 0.0
RAM 68748 68748 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634869 634869 0 0.0
RAM 71388 71388 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634869 634869 0 0.0
RAM 71388 71388 0 0.0
efr32 lock-app BRD4187C FLASH 939760 939760 0 0.0
RAM 159920 159920 0 0.0
BRD4338a FLASH 732744 732744 0 0.0
RAM 234828 234828 0 0.0
window-app BRD4187C FLASH 1032200 1032200 0 0.0
RAM 128024 128024 0 0.0
esp32 all-clusters-app c3devkit DRAM 98736 98736 0 0.0
FLASH 1591774 1591774 0 0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 117516 117516 0 0.0
FLASH 1558614 1558614 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2653563 2653563 0 0.0
RAM 112304 112304 0 0.0
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5973952 5973952 0 0.0
RAM 516568 516568 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5299954 5299954 0 0.0
RAM 222488 222488 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4652302 4652302 0 0.0
RAM 201344 201344 0 0.0
camera-app debug unknown 5456 5456 0 0.0
FLASH 4675470 4675470 0 0.0
RAM 195792 195792 0 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13305215 13305215 0 0.0
RAM 603456 603456 0 0.0
chip-tool-ipv6only arm64 unknown 21976 21976 0 0.0
FLASH 11498104 11498104 0 0.0
RAM 656136 656136 0 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 11569977 11569977 0 0.0
RAM 603240 603240 0 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4455900 4455900 0 0.0
RAM 188168 188168 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5572853 5572853 0 0.0
RAM 471600 471600 0 0.0
lighting-app debug+rpc+ui unknown 6184 6184 0 0.0
FLASH 5519121 5519121 0 0.0
RAM 205168 205168 0 0.0
lock-app debug unknown 5424 5424 0 0.0
FLASH 4692152 4692152 0 0.0
RAM 192344 192344 0 0.0
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4314330 4314330 0 0.0
RAM 181000 181000 0 0.0
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4444682 4444682 0 0.0
RAM 185488 185488 0 0.0
shell debug unknown 4240 4240 0 0.0
FLASH 2982556 2982556 0 0.0
RAM 145688 145688 0 0.0
thermostat-no-ble arm64 unknown 9448 9448 0 0.0
FLASH 4141896 4141896 0 0.0
RAM 229840 229840 0 0.0
tv-app debug unknown 5752 5752 0 0.0
FLASH 5911733 5911733 0 0.0
RAM 595032 595032 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11475709 11475709 0 0.0
RAM 718672 718672 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913684 913684 0 0.0
RAM 142909 142909 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 904428 904428 0 0.0
RAM 125245 125245 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 850464 850464 0 0.0
RAM 141271 141271 0 0.0
nxp contact k32w0+release FLASH 587456 587456 0 0.0
RAM 70980 70980 0 0.0
mcxw71+release FLASH 601272 601272 0 0.0
RAM 63096 63096 0 0.0
light k32w0+release FLASH 613188 613188 0 0.0
RAM 70268 70268 0 0.0
k32w1+release FLASH 685896 685896 0 0.0
RAM 48584 48584 0 0.0
lock mcxw71+release FLASH 750112 750112 0 0.0
RAM 67500 67500 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1658236 1658236 0 0.0
RAM 212344 212344 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1562476 1562476 0 0.0
RAM 208560 208560 0 0.0
light cy8ckit_062s2_43012 FLASH 1441276 1441276 0 0.0
RAM 197296 197296 0 0.0
lock cy8ckit_062s2_43012 FLASH 1470164 1470164 0 0.0
RAM 224960 224960 0 0.0
qpg lighting-app qpg6105+debug FLASH 663852 663852 0 0.0
RAM 105156 105156 0 0.0
lock-app qpg6105+debug FLASH 622312 622312 0 0.0
RAM 99768 99768 0 0.0
stm32 light STM32WB5MM-DK FLASH 459920 459920 0 0.0
RAM 141472 141472 0 0.0
telink bridge-app tl7218x FLASH 669270 669270 0 0.0
RAM 90752 90752 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 622132 622132 0 0.0
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 760918 760918 0 0.0
RAM 40420 40420 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 754026 754026 0 0.0
RAM 97540 97540 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 681076 681076 0 0.0
RAM 52192 52192 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 709634 709634 0 0.0
RAM 73400 73400 0 0.0
light-switch-app-ota-shell-factory-data tl3218x_retention FLASH 702184 702184 0 0.0
RAM 37664 37664 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 601750 601750 0 0.0
RAM 137360 137360 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 789042 789042 0 0.0
RAM 96388 96388 0 0.0
tizen all-clusters-app arm unknown 5144 5144 0 0.0
FLASH 1770756 1770756 0 0.0
RAM 94152 94152 0 0.0
chip-tool-ubsan arm unknown 11492 11492 0 0.0
FLASH 18984862 18984862 0 0.0
RAM 8306668 8306668 0 0.0

@maciejbaczmanski
Copy link
Contributor Author

Just found that external_clusters flag not only allowed skipping the check, but also overriding the implementation for already existing clusters. Closing the PR as this approach would introduce regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants